<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../000-assets/js/vue3.js"></script>
</head>
<body>

    <script>
        // vue2中的响应式原理就是利用了Object.defineProperty()方法
        let obj = {
        }
        let value = '';
        Object.defineProperty(obj,'a',{
            get(){
                return value;
            },
            set(value){
                value = value;
                document.body.innerHTML = value;
            }
        });
    </script>
</body>
</html>